<div id="content" class="clearfix">
    <?php if ($show): ?>
        <h2>Aktivasi</h2>
        <div class="titleInfo"><b>Informasi</b></div>
        <div class="msgInfo">Isilah form berikut dengan benar dan sesuai kartu identitas (KTP/SIM/Passport) untuk mengaktifkan keanggotaan anda.</div>
        <?php $form = $this->beginWidget('CActiveForm'); ?>
        <table width="100%" class="table-common">
            <tr>
                <th colspan="2">Data Jaringan</th>
            </tr>
            <tr>
                <td width="130" align="right">Sponsor ID</td>
                <td><?php echo $form->textField($model, 'member_sponsor', array('size' => 15)); ?><?php echo $form->error($model, 'member_sponsor', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><div id="tempat"></div></td>
            </tr>
            <tr class="even">
                <td align="right">Upline ID</td>
                <td><?php echo $form->textField($model, 'member_upline', array('size' => 15)); ?><?php echo $form->error($model, 'member_upline', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><div id="tempat1"></div></td>
            </tr>
            <tr>
                <td align="right">Posisi</td>
                <td><?php
    $model->position = empty($model->position) ? "L" : "R";
    echo $form->radioButtonList($model, 'position', array('L' => 'Kiri', 'R' => 'kanan'), array('uncheckValue' => null, 'separator' => "&nbsp;&nbsp;",
        'labelOptions' => array('style' => 'display:inline')));
        ?><?php echo $form->error($model, 'position', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
        </table>
        <br />
        <table width="100%" class="table-common">
            <tr>
                <th colspan="2">Data Kartu</th>
            </tr>
            <tr>
                <td width="130" align="right">Serial Number <font color="#dd0000" size="4">*</font></td>
                <td><?php echo $form->textField($model, 'serial_id', array('size' => '15')); ?><?php echo $form->error($model, 'serial_id', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
            <tr class="even">
                <td align="right">PIN <font color="#dd0000" size="4">*</font></td>
                <td><?php echo $form->passwordField($model, 'serial_pin', array('size' => '15')); ?><?php echo $form->error($model, 'serial_pin', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
        </table>
        <br />
        <table width="100%" class="table-common">
            <tr>
                <th colspan="2">Data Login</th>
            </tr>
            <tr valign="top">
                <td width="130" align="right">Password <font color="#dd0000" size="4">*</font></td>
                <td><?php echo $form->passwordField($model, 'password', array('size' => '15')); ?><?php echo $form->error($model, 'password', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><br><small>password minimal 5 karakter</small></td>
            </tr>
            <tr class="even">
                <td align="right">Ulangi Password <font color="#dd0000" size="4">*</font></td>
                <td><?php echo $form->passwordField($model, 'password2', array('size' => '15')); ?><?php echo $form->error($model, 'password2', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
        </table>
        <br />
        <table width="100%" class="table-common">
            <tr>
                <th colspan="2">Data Pribadi</th>
            </tr>
            <tr valign="top">
                <td width="130" align="right">Nama Lengkap <font color="#dd0000" size="4">*</font></td>
                <td><?php echo $form->textField($model, 'member_name', array('size' => '30', 'encode' => false,
                    )); ?><?php echo $form->error($model, 'member_name', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><br /><small>sesuaikan dengan rekening anda</small></td>
            </tr>
            <tr class="even" valign="top">
                <td width="130" align="right">Nama Alias <font color="#dd0000" size="4">*</font></td>
                <td><?php echo $form->textField($model, 'member_nickname', array('size' => '30')); ?><?php echo $form->error($model, 'member_nickname', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
            <tr>
                <td align="right">E-mail</td>
                <td><?php echo $form->textField($model, 'member_email', array('size' => 50)); ?></td>
            </tr>
            <tr class="even" valign="top">
                <td align="right">No. Handphone <font color="#dd0000" size="4">*</font></td>
                <td><?php echo $form->textField($model, 'member_mobilephone', array('size' => 20)); ?><?php echo $form->error($model, 'member_mobilephone', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><br /><small>Nomor ini otomatis akan terdaftar sebagai Nomor Agen</small></td>
            </tr>
        </table>
        <br />
        <table width="100%" class="table-common">
            <tr><th colspan="2">Data Bank</th></tr>
            <tr>
                <td width="130" align="right">Nama Nasabah</td>
                <td class="target">
                  <?php
                   // echo $form->textField($model,'member_bank_account_name', array('size' => 40,'class'=>'target'));
                    ?>   
               
                </td>
            </tr>
             <tr>
                <td width="130" align="right">Nama Bank</td>
                <td>
                    <?php
                   // echo CHtml::activeDropDownList($model, 'member_bank_id', CHtml::listData(ref_bank::model()->findAll("bank_is_active = '1'"), 'bank_id', 'bank_name'));
                   echo $form->dropDownList($model,'member_bank_id',CHtml::listData(ref_bank::model()->findAll("bank_is_active = '1'"), 'bank_id', 'bank_name'));
                    ?>
                </td>
            </tr>
            <tr>
                <td width="130" align="right">Kota Bank</td>
                <td>
                    <?php
                    echo $form->textField($model,'member_bank_city', array('size' => 40,'value'=>'N/A')    );
                    ?>
                  
            </tr>
            <tr>
                <td width="130" align="right">Cabang</td>
                <td>
                    <?php
                    echo $form->textField($model,'member_bank_branch', array('size' => 40,'value'=>'N/A'));
                    ?> 
                   
                </td>
            </tr>
            
            <tr>
                <td width="130" align="right">Nomor Rekening</td>
                <td>
                  <?php
                    echo $form->textField($model,'member_bank_account_no', array('size' => 40,'value'=>'N/A'));
                    ?>     
                  
                </td>
            </tr> 
            
        </table>
        <br />
       
        <table width="100%" class="table-common">
            <tr><th>Ketentuan Registrasi</th></tr>
            <tr><td><?php echo $form->checkbox($model, "fix", array("value" => "active", 'uncheckValue' => '')); ?> Saya telah membaca dan menyetujui <i>Term of Service</i>.<?php echo $form->error($model, 'fix', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td></tr>
        </table>
        <br />
        <script>
            function get_checkbox() {
                var pos = document.getElementsByName('registrasi_form[position]');
                var length = pos.length;
                for(var i = 0;i < length; i++) {
                    if(pos[i].checked) {
                        var position = pos[i].value;
                    }
                }
                return position == 'R'?'kanan':'kiri';
            }  
            
        
        $("#registrasi_form_member_name").keyup(function () {
          var value = $(this).val();
          $(".target").text(value);
        }).keyup();
        </script>
        <center>
            <?php
            $str_javascript = "var pos = get_checkbox();if(confirm('Sponsor anda: '+document.getElementById('" . CHtml::activeId($model, 'member_sponsor') . "').value+' \\r\\nUpline anda: '+document.getElementById('" . CHtml::activeId($model, 'member_upline') . "').value+'\\r\\nPosisi Node anda: '+pos+'\\r\\n\\r\\nApakah Anda yakin akan data tersebut ?')) return true; else return false;";
            ?>
            <?php echo CHtml::submitButton('', array("onclick" => $str_javascript, 'encode' => false, "class" => "btn-reg")); ?>
        </center>
        <br /> 
        <?php $this->endWidget(); ?>
    <?php else: ?>
        <?php echo $message; ?>
    <?php endif; ?>
</div>
